/*
day148
2020.1.23
*/

#include<iostream>
using namespace std;

class MyHashSet 
{
	struct Node{
		int val;
		Node *next;
		Node() : val(-1),next(NULL){};
		Node(int x) : val(x),next(NULL){};
	};
	Node *arr;
	int size=100; 

public:
	
    /** Initialize your data structure here. */
    MyHashSet() 
	{
		arr=new Node[size];
        for(int i=0;i<size;i++)
        {
        	(arr+i)->next=NULL;
		}
    }
    
    void add(int key) 
	{
        Node *tem=new Node(key);
        Node *head=(arr+(key%size));
        tem->next=head->next;
        head->next=tem;
    }
    
    void remove(int key) 
	{
        Node *p=(arr+(key%size));
        while(p->next)
        {
        	if(p->next->val==key)
			{
				Node *tem=p->next;
				p->next=p->next->next;
				delete(tem);
			}
			else
			{
				p=p->next;
			}	
        	
		}
		
    }
    
    /** Returns true if this set contains the specified element */
    bool contains(int key) 
	{
        Node *p=(arr+(key%size));
        while(p)
        {
        	if(p->val==key)	return true;
        	p=p->next;
		}
		return false;
    }
};

int main()
{
	return 0;
}
